/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scsgtbarchusu")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scsgtbarchusu.findAll", query = "SELECT s FROM Scsgtbarchusu s"),
    @NamedQuery(name = "Scsgtbarchusu.findByScsgtbarchusuid", query = "SELECT s FROM Scsgtbarchusu s WHERE s.scsgtbarchusuid = :scsgtbarchusuid"),
    @NamedQuery(name = "Scsgtbarchusu.findByNombre", query = "SELECT s FROM Scsgtbarchusu s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scsgtbarchusu.findByMostrar", query = "SELECT s FROM Scsgtbarchusu s WHERE s.mostrar = :mostrar"),
    @NamedQuery(name = "Scsgtbarchusu.findByObservaciones", query = "SELECT s FROM Scsgtbarchusu s WHERE s.observaciones = :observaciones")})
public class Scsgtbarchusu implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scsgtbarchusuid")
    private Integer scsgtbarchusuid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mostrar")
    private boolean mostrar;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scsgtbrolesid", referencedColumnName = "scsgtbrolesid")
    @ManyToOne(optional = false)
    private Scsgtbroles scsgtbrolesid;

    public Scsgtbarchusu() {
    }

    public Scsgtbarchusu(Integer scsgtbarchusuid) {
        this.scsgtbarchusuid = scsgtbarchusuid;
    }

    public Scsgtbarchusu(Integer scsgtbarchusuid, String nombre, boolean mostrar, String observaciones) {
        this.scsgtbarchusuid = scsgtbarchusuid;
        this.nombre = nombre;
        this.mostrar = mostrar;
        this.observaciones = observaciones;
    }

    public Integer getScsgtbarchusuid() {
        return scsgtbarchusuid;
    }

    public void setScsgtbarchusuid(Integer scsgtbarchusuid) {
        this.scsgtbarchusuid = scsgtbarchusuid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public boolean getMostrar() {
        return mostrar;
    }

    public void setMostrar(boolean mostrar) {
        this.mostrar = mostrar;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scsgtbroles getScsgtbrolesid() {
        return scsgtbrolesid;
    }

    public void setScsgtbrolesid(Scsgtbroles scsgtbrolesid) {
        this.scsgtbrolesid = scsgtbrolesid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scsgtbarchusuid != null ? scsgtbarchusuid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scsgtbarchusu)) {
            return false;
        }
        Scsgtbarchusu other = (Scsgtbarchusu) object;
        if ((this.scsgtbarchusuid == null && other.scsgtbarchusuid != null) || (this.scsgtbarchusuid != null && !this.scsgtbarchusuid.equals(other.scsgtbarchusuid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scsgtbarchusu[ scsgtbarchusuid=" + scsgtbarchusuid + " ]";
    }
    
}
